/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package ria.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import ria.RiaPackage;
import ria.TileList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Tile List</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link ria.impl.TileListImpl#getMaxColumns <em>Max Columns</em>}</li>
 *   <li>{@link ria.impl.TileListImpl#getMinColumns <em>Min Columns</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class TileListImpl extends WDataViewImpl implements TileList {
	/**
	 * The default value of the '{@link #getMaxColumns() <em>Max Columns</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMaxColumns()
	 * @generated
	 * @ordered
	 */
	protected static final int MAX_COLUMNS_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getMaxColumns() <em>Max Columns</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMaxColumns()
	 * @generated
	 * @ordered
	 */
	protected int maxColumns = MAX_COLUMNS_EDEFAULT;

	/**
	 * The default value of the '{@link #getMinColumns() <em>Min Columns</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMinColumns()
	 * @generated
	 * @ordered
	 */
	protected static final int MIN_COLUMNS_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getMinColumns() <em>Min Columns</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMinColumns()
	 * @generated
	 * @ordered
	 */
	protected int minColumns = MIN_COLUMNS_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected TileListImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return RiaPackage.Literals.TILE_LIST;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getMaxColumns() {
		return maxColumns;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setMaxColumns(int newMaxColumns) {
		int oldMaxColumns = maxColumns;
		maxColumns = newMaxColumns;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, RiaPackage.TILE_LIST__MAX_COLUMNS, oldMaxColumns, maxColumns));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getMinColumns() {
		return minColumns;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setMinColumns(int newMinColumns) {
		int oldMinColumns = minColumns;
		minColumns = newMinColumns;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, RiaPackage.TILE_LIST__MIN_COLUMNS, oldMinColumns, minColumns));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case RiaPackage.TILE_LIST__MAX_COLUMNS:
				return getMaxColumns();
			case RiaPackage.TILE_LIST__MIN_COLUMNS:
				return getMinColumns();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case RiaPackage.TILE_LIST__MAX_COLUMNS:
				setMaxColumns((Integer)newValue);
				return;
			case RiaPackage.TILE_LIST__MIN_COLUMNS:
				setMinColumns((Integer)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case RiaPackage.TILE_LIST__MAX_COLUMNS:
				setMaxColumns(MAX_COLUMNS_EDEFAULT);
				return;
			case RiaPackage.TILE_LIST__MIN_COLUMNS:
				setMinColumns(MIN_COLUMNS_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case RiaPackage.TILE_LIST__MAX_COLUMNS:
				return maxColumns != MAX_COLUMNS_EDEFAULT;
			case RiaPackage.TILE_LIST__MIN_COLUMNS:
				return minColumns != MIN_COLUMNS_EDEFAULT;
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (maxColumns: ");
		result.append(maxColumns);
		result.append(", minColumns: ");
		result.append(minColumns);
		result.append(')');
		return result.toString();
	}

} //TileListImpl
